package com.zhu.storesmanager;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.WindowManager;

/**
 * 闪屏界面
 */
public class FlashActivity extends Activity{

	private static final int MSG_FLASHEND = 0; //闪屏结束消息

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //全屏
		setContentView(R.layout.activity_flash);
		mHandler.sendEmptyMessageDelayed(MSG_FLASHEND, 2000); //闪屏2S
	}

	private Handler mHandler = new Handler() {
        public void handleMessage(Message msg) {
            switch (msg.what) {
            	case MSG_FLASHEND: //处理闪屏结束消息
            		gotoLongin();
            		break;
            }
        }
	};

	/**
	 * 跳转登陆界面
	 */
	private void gotoLongin(){
		Intent intent = new Intent();
		intent.setClass(this, UserLoginActivity.class);
		startActivity(intent);
		finish();
	}
}
